export const LOGUNSUCCESS = 'LOGUNSUCCESS'
export const TOGGLECOLLECTLIST = 'TOGGLECOLLECTLIST'
export const ADDBROWERLIST = 'ADDBROWERLIST'
export const REMOTEBROWERLIST = 'REMOTEBROWERLIST'
export const QUITLOGIN = 'QUITLOGIN'
export const ADDSEARCH = 'ADDSEARCH'
export const REMOVESEARCH = 'REMOVESEARCH'
// 登录成功
export function loginSuccess(userInfo) {
  return dispatch => {
    dispatch({ type: LOGUNSUCCESS, payload: userInfo })
  }
}

// 退出登录
export function quitLogin() {
  return dispatch => {
    dispatch({ type: QUITLOGIN })
  }
}

// 加入 ｜ 取消收藏
export function toggleCollectList(payload) {
  return dispatch => {
    dispatch({ type: TOGGLECOLLECTLIST, payload: payload })
  }
}

// 加入浏览记录
export function addBrowerList(payload) {
  return dispatch => {
    dispatch({ type: ADDBROWERLIST, payload: payload })
  }
}


// 删除浏览记录
export function removeBrowerList(payload) {
  return dispatch => {
    dispatch({ type: REMOTEBROWERLIST, payload: payload })
  }
}
export const ADDADDRESSLIST  = 'ADDADDRESSLIST'
export const REMOVEADDRESSLIST  = 'REMOVEADDRESSLIST'
export const EDITADDRESSLIST  = 'EDITADDRESSLIST'
export const DEFAULTADDRESSLIST = 'DEFAULTADDRESSLIST'
// 添加收获地址
export function addAddressList(payload) {
  return dispatch => {
    dispatch({ type: ADDADDRESSLIST, payload })
  }
}
// 删除收获地址
export function removeAddressList(payload) {
  return dispatch => {
    dispatch({ type: REMOVEADDRESSLIST, payload })
  }
}
// 修改收获地址
export function editAddressList(payload) {
  return dispatch => {
    dispatch({ type: EDITADDRESSLIST, payload })
  }
}


// 设置默认收获地址
export function defaultAddressList(payload) {
  return dispatch => {
    dispatch({ type: DEFAULTADDRESSLIST, payload })
  }
}
